package com.sright.bcard.user.share.service;

import com.sright.bcard.common.service.share.dto.LoginUser;
import com.sright.bcard.common.service.share.dto.pager.Pager;
import com.sright.bcard.common.service.share.dto.request.VisitorPageRequest;
import com.sright.bcard.common.service.share.dto.response.VisitorPageResponse;
import com.sright.bcard.user.share.request.AddVisitorParamRequest;
import com.sright.common.response.SrightResponse;
import com.sright.bcard.user.share.request.AnalysisListParam;

import javax.servlet.http.HttpServletRequest;

/**
 * 访客service
 */
public interface VisitorService {

    /**
     * 获取名片访客排名
     * @param loginUser
     * @return
     */
    SrightResponse getVisitorRanking(LoginUser loginUser);

    /**
     * 获取名片访问概况
     * @param loginUser
     * @return
     */
    SrightResponse getVisitorOverview(LoginUser loginUser);

    /**
     * 访客分析 - 上级人脉
     * @param id
     * @return
     */
    SrightResponse parentRelationship(Long id);

    /**
     * 访客分析 - 下级人脉
     * @param id
     * @return
     */
    SrightResponse childrenRelationship(Long id);

    /**
     * 记录访问者
     * @param addVisitorParamRequest
     * @return
     */
    SrightResponse recordVisitor(AddVisitorParamRequest addVisitorParamRequest, HttpServletRequest request) throws Exception;

    /**
     * 记录访问时间
     * @param recordId
     * @param time
     * @return
     */
    SrightResponse recordAccessTime(Long recordId, Integer time);

    /**
     * 分页查询访客列表
     * @param visitorPageRequest
     * @return
     */
    SrightResponse<Pager<VisitorPageResponse>> pageVisitorList(VisitorPageRequest visitorPageRequest);

    SrightResponse visitorAnalysisList(AnalysisListParam analysisListParam);

    void dataPushDay() throws Exception;
}
